package cn.hm.config;

import org.apache.activemq.command.ActiveMQTopic;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.jms.Topic;

/**
 * @author Mxb
 * @version 1.0
 * @date 2020/8/1 11:15
 */
@Configuration
@ConditionalOnClass(value = ActiveMQTopic.class)
public class ActiveMQConfig {

    @Value("${boot-topic}")
    private String topicName;

    @Bean
    public Topic topic() {
        return new ActiveMQTopic(topicName);
    }

}
